//
//  HotSpotsView.m
//  TravelOcean
//
//  Created by double Mac on 15/3/7.
//  Copyright (c) 2015年 double Mac. All rights reserved.
//

#import "HotSpotsView.h"

@implementation HotSpotsView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)dealloc
{
    [_view1 release];
    [_view2 release];
    [_view3 release];
    [_view4 release];
    [_view5 release];
    [_view6 release];
    [_view7 release];
    [_view8 release];
    [_view9 release];
    [_view10 release];
    [_view14 release];
    
    [_label1 release];
    [_label2 release];
    [_label3 release];
    [_label4 release];
    [_label5 release];
    [_label6 release];
    [_label7 release];
    [_label8 release];
    [_label9 release];
    [_label10 release];
    [_label14 release];
    [super dealloc];
}

- (void)createSubviews
{
    self.contentSize = CGSizeMake(375, 1230 - 64);
    self.backgroundColor = [UIColor colorWithRed:240/256.0 green:248/256.0 blue:219/256.0 alpha:1.0];
    
    UIImageView *classImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 300)];
    classImageView.image = [UIImage imageNamed:@"bg_share_large@2x.png"];
    classImageView.userInteractionEnabled = YES;
    [self addSubview:classImageView];
    [classImageView release];
    
    
    UIImageView *backImageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 80, 30)];
    backImageView1.image = [UIImage imageNamed:@"bg_common_selectlarge_pressed@2x.png"];
    [classImageView addSubview:backImageView1];
    [backImageView1 release];
    
    UILabel *aLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, backImageView1.frame.size.width, backImageView1.frame.size.height)];
    aLabel.text = @"景色宜人";
    [backImageView1 addSubview:aLabel];
    [aLabel release];
    
    self.sView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, aLabel.frame.origin.y + aLabel.frame.size.height + 10, self.frame.size.width, 150)];
    self.sView.contentSize = CGSizeMake(self.frame.size.width * 3, 150);
    self.sView.bounces = NO;
    self.sView.pagingEnabled = YES;
    [classImageView addSubview:self.sView];
    [_sView release];
    
    self.view1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.sView.frame.size.width, 150)];
    self.view1.userInteractionEnabled = YES;
    [self.sView addSubview:self.view1];
    [_view1 release];
    
    self.label1 = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, 55, 30)];
    self.label1.text = @"  樱花";
    self.label1.layer.cornerRadius = 15;
    self.label1.layer.masksToBounds = YES;
    self.label1.userInteractionEnabled = YES;
    self.label1.textColor = [UIColor whiteColor];
    self.label1.backgroundColor = [UIColor blackColor];
    
    [self.view1 addSubview:self.label1];
    [_label1 release];
    
    
    self.view2 = [[UIImageView alloc] initWithFrame:CGRectMake(self.sView.frame.size.width, 0, self.sView.frame.size.width, 150)];
    self.view2.userInteractionEnabled = YES;
    [self.sView addSubview:self.view2];
    [_view2 release];
    
    self.label2 = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 55, 30)];
    self.label2.text = @"  古镇";
    self.label2.layer.cornerRadius = 15;
    self.label2.layer.masksToBounds = YES;
    self.label2.userInteractionEnabled = YES;
    self.label2.textColor = [UIColor whiteColor];
    self.label2.backgroundColor = [UIColor blackColor];
    [self.view2 addSubview:self.label2];
    [_label2 release];
    
    self.view3 = [[UIImageView alloc] initWithFrame:CGRectMake(self.sView.frame.size.width * 2, 0, self.sView.frame.size.width, 150)];
    self.view3.userInteractionEnabled = YES;
    [self.sView addSubview:self.view3];
    [_view3 release];
    
    self.label3 = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 55, 30)];
    self.label3.text = @"  温泉";
    self.label3.layer.cornerRadius = 15;
    self.label3.layer.masksToBounds = YES;
    self.label3.userInteractionEnabled = YES;
    self.label3.textColor = [UIColor whiteColor];
    self.label3.backgroundColor = [UIColor blackColor];
    [self.view3 addSubview:self.label3];
    [_label3 release];
    
    UIImageView *classImageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.sView.frame.origin.y + self.sView.frame.size.height + 120, self.frame.size.width, 300)];
    classImageView2.image = [UIImage imageNamed:@"bg_share_large@2x.png"];
    classImageView2.userInteractionEnabled = YES;
    [self addSubview:classImageView2];
    [classImageView2 release];
    
    UIImageView *backImageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(5, self.sView.frame.origin.y + self.sView.frame.size.height + 130, 80, 30)];
    backImageView2.image = [UIImage imageNamed:@"bg_common_selectlarge_pressed@2x.png"];
    [self addSubview:backImageView2];
    [backImageView2 release];
    
    UILabel *bLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, backImageView2.frame.size.width, backImageView2.frame.size.height)];
    bLabel.text = @"豁然开朗";
    [backImageView2 addSubview:bLabel];
    [bLabel release];
    
    self.view4 = [[UIImageView alloc] initWithFrame:CGRectMake(10, backImageView2.frame.origin.y + backImageView2.frame.size.height + 5, self.frame.size.width - 20, 150)];
    self.view4.userInteractionEnabled = YES;
    self.view4.layer.cornerRadius = 10;
    self.view4.layer.masksToBounds = YES;
    [self addSubview:self.view4];
    [_view4 release];
    
    self.label4 = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 55, 30)];
    self.label4.text = @"  看海";
    self.label4.layer.cornerRadius = 15;
    self.label4.layer.masksToBounds = YES;
    self.label4.userInteractionEnabled = YES;
    self.label4.textColor = [UIColor whiteColor];
    self.label4.backgroundColor = [UIColor blackColor];
    [self.view4 addSubview:self.label4];
    [_label4 release];
    
//    self.view5 = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.view4.frame.origin.y + self.view4.frame.size.height + 10, 121.5, 50)];
//    self.view5.userInteractionEnabled = YES;
//    [self addSubview:self.view5];
//    [_view5 release];
//    
//    self.label5 = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 100, 30)];
//    [self.view5 addSubview:self.label5];
//    [_label5 release];
//    
//    self.view6 = [[UIImageView alloc] initWithFrame:CGRectMake(126.5, self.view4.frame.origin.y + self.view4.frame.size.height + 10, 121.5, 50)];
//    self.view6.userInteractionEnabled = YES;
//    [self addSubview:self.view6];
//    [_view6 release];
//    
//    self.label6 = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 100, 30)];
//    [self.view6 addSubview:self.label6];
//    [_label6 release];
//    
//    self.view7 = [[UIImageView alloc] initWithFrame:CGRectMake(253, self.view4.frame.origin.y + self.view4.frame.size.height + 10, 122, 50)];
//    self.view7.userInteractionEnabled = YES;
//    [self addSubview:self.view7];
//    [_view7 release];
//    
//    self.label7 = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 100, 30)];
//    [self.view7 addSubview:self.label7];
//    [_label7 release];
    
    
    
    UIImageView *backImageView3 = [[UIImageView alloc] initWithFrame:CGRectMake(5, self.view4.frame.origin.y + self.view4.frame.size.height + 100, 80, 30)];
    backImageView3.image = [UIImage imageNamed:@"bg_common_selectlarge_pressed@2x.png"];
    [self addSubview:backImageView3];
    [backImageView3 release];
    
    UILabel *cLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, backImageView3.frame.size.width, backImageView3.frame.size.height)];
    cLabel.text = @"体验自我";
    [backImageView3 addSubview:cLabel];
    [cLabel release];

    self.view8 = [[UIImageView alloc] initWithFrame:CGRectMake(10, self.view4.frame.origin.y + self.view4.frame.size.height + 135, self.frame.size.width / 2 - 20, 75)];
    self.view8.userInteractionEnabled = YES;
    self.view8.layer.cornerRadius = 10;
    self.view8.layer.masksToBounds = YES;
    [self addSubview:self.view8];
    [_view8 release];
    
    self.label8 = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 55, 30)];
    self.label8.text = @"  登山";
    self.label8.layer.cornerRadius = 15;
    self.label8.layer.masksToBounds = YES;
    self.label8.userInteractionEnabled = YES;
    self.label8.textColor = [UIColor whiteColor];
    self.label8.backgroundColor = [UIColor blackColor];
    [self.view8 addSubview:self.label8];
    [_label8 release];
    
    self.view9 = [[UIImageView alloc] initWithFrame:CGRectMake(190, self.view4.frame.origin.y + self.view4.frame.size.height + 135, self.frame.size.width / 2 - 20, 75)];
    self.view9.userInteractionEnabled = YES;
    self.view9.layer.cornerRadius = 10;
    self.view9.layer.masksToBounds = YES;
    [self addSubview:self.view9];
    [_view9 release];
    
    self.label9 = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 55, 30)];
    self.label9.text = @"  漂流";
    self.label9.layer.cornerRadius = 15;
    self.label9.layer.masksToBounds = YES;
    self.label9.userInteractionEnabled = YES;
    self.label9.textColor = [UIColor whiteColor];
    self.label9.backgroundColor = [UIColor blackColor];
    [self.view9 addSubview:self.label9];
    [_label9 release];
    
    self.view10 = [[UIImageView alloc] initWithFrame:CGRectMake(10, self.view8.frame.origin.y + self.view8.frame.size.height + 10, self.frame.size.width - 20, 150)];
    self.view10.userInteractionEnabled = YES;
    self.view10.layer.cornerRadius = 10;
    self.view10.layer.masksToBounds = YES;
    [self addSubview:self.view10];
    [_view10 release];
    
    self.label10 = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 105, 30)];
    self.label10.text = @"  春节广东游";
    self.label10.layer.cornerRadius = 15;
    self.label10.layer.masksToBounds = YES;
    self.label10.userInteractionEnabled = YES;
    self.label10.textColor = [UIColor whiteColor];
    self.label10.backgroundColor = [UIColor blackColor];
    [self.view10 addSubview:self.label10];
    [_label10 release];
    
    UIImageView *backImageView4 = [[UIImageView alloc] initWithFrame:CGRectMake(5, self.view10.frame.origin.y + self.view10.frame.size.height + 10, 80, 30)];
    backImageView4.image = [UIImage imageNamed:@"bg_common_selectlarge_pressed@2x.png"];
    [self addSubview:backImageView4];
    [backImageView4 release];
    
    UILabel *dLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, backImageView4.frame.size.width, backImageView4.frame.size.height)];
    dLabel.text = @"美好时节";
    [backImageView4 addSubview:dLabel];
    [dLabel release];
    
    self.view14 = [[UIImageView alloc] initWithFrame:CGRectMake(10, self.view10.frame.origin.y + self.view10.frame.size.height + 105, self.frame.size.width - 20, 150)];
    self.view14.userInteractionEnabled = YES;
    self.view14.layer.cornerRadius = 10;
    self.view14.layer.masksToBounds = YES;
    [self addSubview:self.view14];
    [_view14 release];
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
